import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  //代理配置
  server: {
    port: 3000,
    proxy: {
      '^/api': {
        target: "http://chst.vip",
        rewrite: (path) => path.replace(/^\/api/, "")
      }
    }
  },
  resolve: {
    //别名配置
    alias: {
      "@": path.resolve("src"),
      "components": path.resolve('components'),
      "assets": path.resolve('assets')
    }
  }
})
